exports.path = '/dba/osqlSessions';
exports.title = '来自oracle-sql-lib下的活动会话';
exports.sqltext = `
select a.* from v$session a where a.module = 'ora-sql-lib'
`;
exports.sqltext = ({
  columns,
  basicColumns,
  activeOnly,
}) => {
  if (basicColumns) {
    columns = 'SID,STATUS,MODULE,ACTION,LOGON_TIME,CLIENT_INFO,SCHEMANAME,EVENT,WAIT_CLASS,STATE';
  }
  return `
  select ${columns || 'a.*'}
  from v$session a
  where a.module = 'ora-sql-lib'
  ${activeOnly ? "and a.status='ACTIVE'" : ''}
  `;
};
exports.pool = 'task';

exports.request = {
  columns: 'SID,MODULE,ACTION,CLIENT_INFO,SCHEMANAME,EVENT,WAIT_CLASS,STATE', // 查看哪些列
  basicColumns: 1, // 只查看基本列
  activeOnly: 1, // 只查看活动会话
};
